package com.example.module_motocircle.api

import com.example.lib_common.base.BaseResponse
import com.example.module_motocircle.model.CommentModel
import com.example.module_motocircle.model.DetailModel
import com.example.module_motocircle.model.NavigationItemModel
import com.example.module_motocircle.model.PostListModel
import com.example.module_motocircle.model.SearchModelItem



import retrofit2.http.GET
import retrofit2.http.Query

interface MotocircleApi {
    /**
     * 顶部导航
     */
    @GET("/app/motorCircle/navigationItem")
    suspend fun getNavigationItem(): BaseResponse<NavigationItemModel>

    /**
     * 帖子列表
     */
    @GET("/app/postsInfo/pageList")
    suspend fun getPostData(
        @Query("sortType") sortType: String? = null,
        @Query("topicId") topicId: String? = null,
        @Query("memberId") memberId: String? = null,
        @Query("isFocus") ifFocus: Int? = null,
        @Query("pageNum") pageNum: Int,
        @Query("pageSize") pageSize: Int = 10,
        @Query("keyword") keyword: String? = null
    ):BaseResponse<PostListModel>
    /**
     * 是否有关注的人
     */
    @GET("/app/friend/checkIfHasFocus")
    suspend fun checkIfHasFocus(): BaseResponse<Boolean>
    /**
     * 校验帖子
     */
    @GET("/app/postsInfo/giveValidationLike")
    suspend fun giveValidationLike(@Query("postsId") postsId:String):BaseResponse<Boolean>
    /**
     * 点赞取消点赞
     */
    @GET("/app/postsInfo/giveLike")
    suspend fun giveLike(@Query("postsId") postsId:String):BaseResponse<Boolean>
    /**
     * 关键字搜索
     */
    @GET("/app/search/searchKeywordList")
    suspend fun searchKeywordList(@Query("keyword") keyword:String):BaseResponse<List<SearchModelItem>>
    /**
     * 帖子详情
     */
    @GET("/app/postsInfo/getByPostsId?postsId=1905528400386129921")
    suspend fun getDetailInfo():BaseResponse<DetailModel>

    /**
     * 帖子评论
     */
    @GET("/app/postsComment/pageComment?postsId=1905528400386129921")
    suspend fun getCommentInfo(@Query("pageNum") pageNum:Int,@Query("pageSize") pageSize:Int):BaseResponse<CommentModel>
}